package com.project.service.impl;

import com.project.bean.ProgressBean;
import com.project.mapper.IProgressMapper;
import com.project.service.IProgressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDate;

@Service
@Transactional
public class ProgressServiceImpl implements IProgressService {
    @Autowired
    private IProgressMapper mapper;
    @Override
    public void updateCompleteDate(int id) {
        mapper.updateCompleteDate(id,LocalDate.now()+"");
    }

    @Override
    public void addProgress(ProgressBean progressBean) {
        mapper.addProgress(progressBean);
    }

    @Override
    public void updateState(int projectId) {
        mapper.updateState(projectId,"交付使用");
        mapper.updateDate(projectId, LocalDate.now()+"");
    }
}
